<template>
  <main class="mobile-home">
    <div class="home-title">
      <div class="title-container">
        <img :src="getAssetsImageFile('logo/logo.png')" alt="暂无图片" class="logo"/>
        <span class="title">Sweet Hut</span>
      </div>

      <el-button circle @click="appStore.toggleDark" class="theme-button">
        {{ appStore.isDark ? '🌙' : '☀️' }}
      </el-button>
    </div>

    <weather-time-card />

<!--    <el-carousel height="150px">-->
<!--      <el-carousel-item v-for="item in 4" :key="item">-->
<!--        <h3>{{ item }}</h3>-->
<!--      </el-carousel-item>-->
<!--    </el-carousel>-->

    <div class="module-list">
      <module-card icon="iconfont icon-fenlei" color="#00CED1"
                   title="博客文章" sub-title="分享学习点滴"
                   router="/blog/overview"/>

      <module-card icon="iconfont icon-zhangdan" color="#FFCC00"
                   title="账单记录" sub-title="收支一目了然"
                   router="/bill/data"/>

      <module-card icon="iconfont icon-caipu" color="#006400"
                   title="美食记录" sub-title="品味人间烟火"
                   router="/food/recipe"/>

      <module-card icon="iconfont icon-jingdian" color="#FF9966"
                   title="旅行记录" sub-title="足迹遍及四方"
                   router="/travel/spot"/>

      <module-card icon="iconfont icon-wupin" color="#19107E"
                   title="物品记录" sub-title="收纳生活琐碎"
                   router="/product/list"/>

      <module-card icon="iconfont icon-paiban" color="#9933FF"
                   title="日程安排" sub-title="规划每日时光"
                   router="/plan/calendar"/>

      <module-card icon="iconfont icon-richeng" color="#228B22"
                   title="纪念日" sub-title="铭记重要时刻"
                   router="/anniversary/list"/>

      <module-card icon="iconfont icon-yuejing" color="#DE3163"
                   title="月经记录" sub-title="关注健康周期"
                   router="/period/calendar"/>

      <module-card icon="iconfont icon-riji" color="#FF69B4"
                   title="时光手账" sub-title="书写流动岁月"
                   router="/journal/record"/>

      <module-card icon="iconfont icon-jixiao" color="#003366"
                   title="绩效统计" sub-title="绩刻拼搏印记 "
                   router="/kpi/record"/>

      <module-card icon="iconfont icon-zichan" color="#FFA500"
                   title="家庭资产" sub-title="统筹全家财富"
                   router="/asset/list"/>

      <module-card icon="iconfont icon-zhangben" color="#388E3C"
                   title="家庭账本" sub-title="守护家庭财富"
                   router="/ledger/list"/>

      <module-card icon="iconfont icon-ai-password" color="#4361EE"
                   title="密码管家" sub-title="守护数字安全"
                   router="/password/list"/>

      <module-card icon="iconfont icon-fuwuqi" color="#FF6B6B"
                   title="服务监控" sub-title="掌握系统健康"
                   router="/server/monitor"/>
    </div>

<!--    <div class="note-container">-->
<!--      <div class="content">-->
<!--        <span class="title">消息中心</span>-->
<!--      </div>-->
<!--      <div class="note-list">-->
<!--        <div class="note">-->

<!--        </div>-->
<!--      </div>-->
<!--    </div>-->
  </main>
</template>

<script setup lang="ts">
import WeatherTimeCard from '@/components/Common/WeatherTimeCard.vue'
import ModuleCard from '@/components/ModuleCard.vue'
import { useAppStore } from '@/store/app'
import { getAssetsImageFile } from '@/utils'

const appStore = useAppStore()
</script>

<style lang="scss">
.mobile-home {
  height: 100%;
  background-color: var(--color-bg);
  color: var(--color-text);
  padding: 10px;

  display: flex;
  flex-direction: column;
  gap: 10px;

  .home-title {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    .title-container {
      display: flex;
      align-items: center;
      gap: 5px;

      .logo {
        width: 30px;
        height: 30px;
      }

      .title {
        font-size: 1.5rem;
        font-weight: bold;
        text-align: center;
      }
    }

    .theme-button {
      position: absolute;
      right: 0;
      background-color: var(--color-bg);
      border-color: var(--el-color-primary);
    }
  }

  .el-carousel__container {
    .el-carousel__item:nth-child(2n) {
      background-color: #99a9bf;
    }

    .el-carousel__item:nth-child(2n + 1) {
      background-color: #d3dce6;
    }

    h3 {
      text-align: center;
    }
  }

  .module-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .note-container {
    min-height: 200px;
    background-color: var(--color-card-bg);
    border: 1px solid var(--el-color-primary);
    border-radius: 10px;
    padding: 10px;

    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;

    .content {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 2px;
      border-bottom: 1px solid #009FA8;

      .title {
        font-weight: bold;
      }
    }
  }
}
</style>
